<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/basicTemplate.xhtml">

	<ui:define name="content">
	
	<title>
		<h:outputText value="#{msg.ticket}" />
	</title>
	
<link rel="stylesheet" type="text/css" media="all" href="jsDatePick_ltr.min.css" />

<script type="text/javascript" src="jsDatePick.min.1.3.js"></script>

<script type="text/javascript">
	window.onload = function(){
		new JsDatePick({
			useMode:2,
			target:"form2:startField",
			dateFormat:"%Y-%m-%d"
		});
		
		new JsDatePick({
			useMode:2,
			target:"form2:endField",
			dateFormat:"%Y-%m-%d"
		});
		new JsDatePick({
			useMode:2,
			target:"form1:Field",
			dateFormat:"%Y-%m-%d"
		});
		
	};
	/*
	var startField;
	var endField;
	function getVal()
	{
		startField = document.getElementById('startField').value;
		endField = document.getElementById('endField').value;
		alert("END: " + endField);
		alert("Start: " + startField);
		
	}
	*/
	function fff()
	{
		var alma = "error";
		if (getElementById("form1:hiddenValue").value == alma.value)
			alert("Nu ai setat bine campul pentru data!");
	}
	
	function ff()
	{
		var alma = "error";
		alert("1: " + alma.value());
		alert("2: " + getElementById("form1:hiddenValue").value);
		alert("3: " + alma.value);
		alert("4: " + getElementById("form1:hiddenValue").value());
		alert("5: " + alma);
	}
	
</script>


		<head>
		
		</head>
		<br />
		<f:event listener="#{biletBean.verify()}" type="preRenderView"></f:event>

		<h:form id="form1">
			<div align="center">
			<h2></h2>
			<h:inputHidden value="#{biletBean.hidd}" id="hiddenValue"/>
			<h:outputText value="#{msg.filter}:" />
			<h:selectOneMenu value="#{biletBean.dupa}" styleClass="dropdownlist">
   					<f:selectItem itemValue="#{msg.status}" />
   					<f:selectItem itemValue="#{msg.date}" />
   			</h:selectOneMenu>
   			<h:outputText value=" " />
   			<h:inputText id="valoare" value="#{biletBean.valoare}" 
   			requiredMessage="#{msg.introduceMotiv}" required="true"/>
   			<h:message for="valoare" styleClass="errorMessage"/>
   			<h:commandButton value="OK" action="#{biletBean.filtru()}" 
   			styleClass="button"/>
			<br></br>
			</div>
			</h:form>
			<h:form id="form2">
			<div align="center">
			<div style="overflow-y:scroll;height: 200px;">
			<h:dataTable value="#{biletBean.bilete}" var="item">
  				<h:column>
    				<f:facet name="header">
       					<h:outputText value="#{msg.motive}" />
    				</f:facet>
     				<h:outputText value="#{item.motiv}" />
  				</h:column>
  				<h:column>
    				<f:facet name="header">
       					<h:outputText value="#{msg.start}" />
    				</f:facet>
     				<h:outputText value="#{item.start_time}" />
  				</h:column>
  				<h:column>
    				<f:facet name="header">
       					<h:outputText value="#{msg.end}" />
    				</f:facet>
     				<h:outputText value="#{item.end_time}" />
  				</h:column>
  				<h:column>
    				<f:facet name="header">
       					<h:outputText value="#{msg.status}" />
    				</f:facet>
     				<h:outputText value="#{item.status}" />
  				</h:column>
			</h:dataTable>
			</div>
			<br />
			<h:panelGrid columns="4" styleClass="inner-table login">
				<h:outputText value="#{msg.motive}:" />
				<h:inputText styleClass="inputText" id="motiv" value="#{biletBean.motiv}"
					requiredMessage="#{msg.introduceMotiv}" required="true" />
				<h:message for="motiv" styleClass="errorMessage"/>
				<h:outputText value=" " />
				<h:outputText value="#{msg.start}:" />
				<h:inputText value="#{biletBean.start_an}" id="startField" />
				<h:selectOneMenu value="#{biletBean.start_ora}" styleClass="dropdownlist">
   					<f:selectItem itemValue="08" />
   					<f:selectItem itemValue="09" />
   					<f:selectItem itemValue="10" />
   					<f:selectItem itemValue="11" />
   					<f:selectItem itemValue="12" />
   					<f:selectItem itemValue="13" />
   					<f:selectItem itemValue="14" />
   					<f:selectItem itemValue="15" />
   					<f:selectItem itemValue="16" />
   					<f:selectItem itemValue="17" />
   					<f:selectItem itemValue="18" />
   					<f:selectItem itemValue="19" />
   					<f:selectItem itemValue="20" />
   				</h:selectOneMenu>
   				<h:selectOneMenu value="#{biletBean.start_min}" styleClass="dropdownlist">
   					<f:selectItem itemValue="30" />
   					<f:selectItem itemValue="00" />
   				</h:selectOneMenu>
   				<h:outputText value="#{msg.end}:" />
				<h:inputText id="endField" value="#{biletBean.end_an}" />

				<h:selectOneMenu value="#{biletBean.end_ora}" styleClass="dropdownlist">
   					<f:selectItem itemValue="08" />
   					<f:selectItem itemValue="09" />
   					<f:selectItem itemValue="10" />
   					<f:selectItem itemValue="11" />
   					<f:selectItem itemValue="12" />
   					<f:selectItem itemValue="13" />
   					<f:selectItem itemValue="14" />
   					<f:selectItem itemValue="15" />
   					<f:selectItem itemValue="16" />
   					<f:selectItem itemValue="17" />
   					<f:selectItem itemValue="18" />
   					<f:selectItem itemValue="19" />
   					<f:selectItem itemValue="20" />
   				</h:selectOneMenu>
   				<h:selectOneMenu value="#{biletBean.end_min}" styleClass="dropdownlist">
   					<f:selectItem itemValue="30" />
   					<f:selectItem itemValue="00" />
   				</h:selectOneMenu>
   				<h:outputText value=" " />
	
			</h:panelGrid> <br></br>
			
			<h:commandButton
				value="#{msg.send}" styleClass="button" action="#{biletBean.send()}"/> <br></br>
			<h:commandButton 
				value="#{msg.back}" action="#{loginBean.inapoi()}" styleClass="button" immediate="true"/>
				 <br></br>	
				
			</div>

		</h:form>
	</ui:define>

</ui:composition>

</html>






